package com.niiwoo.civet.trade.enums;

import com.niiwoo.tripod.provider.exception.NoSuchEnumValueException;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 投资订单-回款计划详情展示判断状态
 * 回款状态：1待回款，2按时回款，3逾期中，4逾期已收款，5提前回款(已转让)，6已结清，7已提前结清
 */
@AllArgsConstructor
@Getter
public enum ReceivePaymentStatusEnum {

	NON_RECEIVE((byte) 1, "待回款"),

	NORMAL_RECEIVE((byte) 2, "按时回款"),

	OVERDUE((byte) 3, "逾期中"),

	OVERDUE_RECEIVE((byte)4, "逾期已收款"),

	EARLY_RECEIVE((byte)5, "提前回款"),

	TRANSFERRED((byte)6, "已转让"),

	OVER_DEBT_RECEIVE((byte)7, "已提前结清"),

	OVERDUE_PART_RECEIVE((byte)8, "逾期部分回款");

	private Byte code;

	private String value;

	public static ReceivePaymentStatusEnum enumOf(int code) {
		for (ReceivePaymentStatusEnum receivedStatus : values()) {
			if (receivedStatus.code == code) {
				return receivedStatus;
			}
		}
		throw new NoSuchEnumValueException("ReceivePaymentStatusEnum:" + code);
	}
}
